\section{INSTRUMENTATION} \label{sec:inst}

The hardware used in this work consisted of the several modules necessary to perform the tasks of measuring the engine thrust force, the engine RPM, allowing radio communication between hobby transmitter and circuit, independently commanding the servo actuator and communicating with a standard computer.

The whole achitecture of the istrumentation was based around a low-cost micro-controller unit (MCU). The one chosen for this experiment was the Atmel ATMega168, since it features a programmable serial USART, PWM generation channels, Real Time Counter unit and 10-bit ADC inputs. Also, an open-source compiler and library (avr-gcc, avr-libc) could be used in developing the code, leaving the costs mainly to the circuit components, the MCU programmer and the RC hobby equipment (Radio, Receiver and Servo).

The architecture of the system is described by the diagram in figure \ref{fig:dia_inst}.
\vspace{5mm}
\begin{figure}[h!]
\centering
\includegraphics[angle=0, width=\textwidth]{diag_instrum.pdf}
\caption{Schematic diagram of instrumentation architecture.}
\label{fig:dia_inst}
\end{figure}

Following is a description of each of the modules connected to the MCU:

\paragraph{Thrust Measurement}
The thrust was measured by a load cell with four strain gauges in a full-brigde configuration. The brigde was conected to the power suply and to an ajustable gain amplifier system that also filtered the measured signal using a low-pass filter with cutoff frequency of $20Hz$. The output of the filter was fed directly to an ADC input pin in the micro-controller.

\paragraph{RPM Measurement}
The rotation was measured using an optical sensor. The sensor consists of an light-emitting diode and a photo-sensitive transistor and it works by measuring the amount of reflected light comming from itself (figure \ref{fig:esquema_sensor}). A rounded plate with six symmetrical holes was attached to the engine shaft and the optical sensor was mounted behind this plate (\ref{fig:foto_taco}). The signal coming out of the optical sensor is modified by means of a comparator circuit, in order to produce suitable square waves to feed the MCU. The sensor worked thus as a regular encoder, with the MCU used to count the time between two consecutive pulses in order to deduce the shaft RPM.

\begin{figure}[h!]
  \centering
  \subfloat[Working principle of the optic sensor.]{\label{fig:esquema_sensor}\includegraphics[width=0.4\textwidth]{sensor_opt.pdf}} \qquad
  \subfloat[Detail of the RPM measuring set up.]{\label{fig:foto_taco}\includegraphics[width=0.4\textwidth]{foto_taco.png}}
  \caption{Engine model identification: The step response case.}
  \label{fig:montagem_sensor_opto}
\end{figure}

\paragraph{Throttle lever actuation}
The throttle lever was actuated on by a standard hobby servo, with a range of 90$^{\circ}$. A standard hobby servo command signal consists of a $50Hz$ PWM signal, in which the duty cycle width varies between $1ms$ and $2ms$. This signal was always fed into the servo by the MCU (figure \ref{fig:dia_inst}) whether on safe mode, when it was just tunneled from the RC-Receiver to the servo, or on LabView mode, when the desired PWM width came from the serial port. It is important to notice the impact of the $50Hz$ frequency limit of the servo on the dynamics of the combined servo-engine system.


\paragraph{Serial Communication}
Communication with the computer was accomplished using serial communication protocols (USART\textbackslash{}USB). For more detailed information, refer to section \ref{sec:data_aq}


\paragraph{Safety control channel}
A hobby RC-transmiter radio was used to control the servo position manually during engine startups and eventual needle injection adjustments. The microcontroller was programmed to receive the signal from all six receiver channels. The sixth channel was a toggle switch, which was used to select between ``Manual mode'' or ``Automatic mode''. When in manual mode, the servo position was controlled by the radio operator moving the right stick up or down. When in automatic mode, the microcontroller neglected the servo input from the radio and sent the servo the Labview generated command, which was received via serial port. During all tests, at least three signals were acquired at $50 Hz$: thrust, RPM and servo motor commanded position.
